Coding a WildApplication... how to, tips...

That doc is intended to offer an overview of how to code a WildApp, but you should have read before the other phylosophic docs.

First of all, do all std openings, and also remember to open wild.library. Current version is V1.

You may also need some extensions, so you may open the Vektorial.library, wich contain some useful Rotate and Camera pointing funcs:

VektorialExtensionBase=LoadExtension("Vektorial.library",1);

Then, do these steps:

1) Creating a WildApp structure.

You have to create a MSGPort, first, and it's important that this MSGPort is created by the task that will manage then the WildApp; so, if you want to have the WildApp management done by a sub-task, THIS sub-task has to create the port.

msg=CreateMsgPort();

Then, you create a WildApp struct, by using:

wapp=AddWildAppTags(msg,...tags);

See the tags explanatiion, it's very important.

2) Now, you have a WildApp structure, so you are ready to create the World. You can create it handly (BuildWildObject()) but it's very boring and long; or, you can load it from a file (LoadWildObject()), wich is better also because you can modify the file then without recompiling the program. An example of handly made world is the Kube, a file-loaded one is the SimpleWorld. DO NOT TAKE Cynetik as a model, it's an OLD-CONCEPT app, that had the objects embedded in the code, because done before BuildWildObject() introduction.

3) Now you have to connect the world you have created to the WildApp, so use:

SetWildAppTags(wapp,WITD_Scene,scene);

4) Now, you are ready to enter the rendering cycle. A rendering cycle should look like that (in the future, will comply a bit with message handling for async render, but now it's all synch):

void Cyc()
 {
  while (going)
   {
    InitFrame(wapp);
    RealyzeFrame(wapp);
    DisplayFrame(wapp);
.... here move, rotate, handle your world ...
   }
 }


5) When you exit the cycle, you have to kill your app. All the mem allocated is automatically freed (thank to the Pool concept in AmigaOS), so don't worry for Scenes, Textures, structs... everything is freed with:

RemWildApp(wapp);

6) Bye! bye !